package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

/**
 * 查询用户开发平台信息请求参数类
 *
 * @author lijian
 * @version 2014年3月23日 - 下午2:31:21
 */
public class UserOpenPlatformInfoListRequest extends Request{

	/**
	 * 账号ID
	 */
	private int userId;
	
	/**
	 * 开放平台ID<br>
	 * 1：微信
	 * 2：qq
	 * 3：微博
	 */
	private int openPlatformId;
	
	/** */
	public UserOpenPlatformInfoListRequest() {
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), 0);
		this.openPlatformId = requestInfo.getIntParameter(ApiUrlParamEnum.openPlatformId.getParamName(), 0);
		if ( userId < 1 ) {
			throw new RequestIllegalException("error userId: " + userId);
		}
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getOpenPlatformId() {
		return openPlatformId;
	}

	public void setOpenPlatformId(int openPlatformId) {
		this.openPlatformId = openPlatformId;
	}

}
